package ex.com.jm.food.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;



/**
 * 大类实体层
 * @author zhaojw
 *
 */
@Entity
@Table(name="jm_supType")
public class SupType implements Serializable {

	
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="sup_id",nullable=false,unique=true,length=11)
	private Integer supId;//大类主键
	@Column(name="sup_name",nullable=false,unique=true,length=32)
	private String supName;//大类名称
	@OneToMany(cascade=CascadeType.ALL,mappedBy="supId",fetch=FetchType.EAGER)
	private Set<SubType> subTypes=new HashSet<SubType>();//小类
	@Column(name="created",nullable=false,unique=true,length=32)
	private String created;//大类创建时间
	@Column(name="create_id",nullable=false,unique=true,length=32)
	private String createId;//大类创建的管理员id'
	public Integer getSupId() {
		return supId;
	}
	public void setSupId(Integer supId) {
		this.supId = supId;
	}
	public String getSupName() {
		return supName;
	}
	public void setSupName(String supName) {
		this.supName = supName;
	}
	public String getCreated() {
		return created;
	}
	public void setCreated(String created) {
		this.created = created;
	}
	public String getCreateId() {
		return createId;
	}
	public void setCreateId(String createId) {
		this.createId = createId;
	}
	public Set<SubType> getSubTypes() {
		return subTypes;
	}
	public void setSubTypes(Set<SubType> subTypes) {
		this.subTypes = subTypes;
	}

}
